import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home.vue'
import Newpage from '../views/home/components/Newpage.vue'
import Ranklist from '../views/home/components/Ranklist.vue'
import Searchcircle from '../views/home/components/Searchcircle.vue'
import Mine from "../views/my/Mine.vue"
import indexLayout from "../layout/indexLayout";
import SongList from "../views/home/components/SongList";
import SongDetail from "../views/home/components/SongDetail";
import SongListDetail from "../views/home/components/SongListDetail";
Vue.use(VueRouter)

const routes = [
    {
        path: "/",
        redirect: "/home"
    },
    {
        path: '/index',
        component: indexLayout,
        children: [
            {
                path: "/home",
                component: Home,
                children: [
                    {
                        path: 'New',
                        component: Newpage,
                    },

                    {
                        path: 'Searchcircle',
                        component: Searchcircle,
                    },

                    {
                        path: 'Ranklist',
                        component: Ranklist,
                    },
                ]
            }
        ],
    },
    //榜单列表
    {
        path: '/SongList',
        component: SongList,
    },
    //  歌词详情
    {
        path: '/SongDetail',
        component: SongDetail,
    },
    //  歌单详情
    {
        path: '/ListDetail',
        component: SongListDetail,
    },
    //搜索页面
    {
        path: '/Search',
        component: Searchcircle,
    },
    {
        path: '/my',
        component: Mine,
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
